// Shadowmap Shader

cbuffer cbPerFrame
{
	matrix gLightWVP;
};

struct VSIn
{
	float3 Pos		: POSITION;
	float3 Normal	: NORMAL;
	float2 Tex		: TEXCOORD;
	float3 Tan		: TANGENT;
};

struct PSIn
{
	float4 Pos		: SV_POSITION;
};

PSIn VS( VSIn input )
{
	PSIn output;
	output.Pos = mul( float4( input.Pos, 1.0f ), gLightWVP );
	return output;
};

float4 PS( PSIn input ) : SV_TARGET
{
	float4 diffuse = float4(1.0f, 1.0f, 1.0f, 1.0f);
	clip(diffuse.a - 0.15f);
	return diffuse;
};

DepthStencilState EnableDepth
{
    DepthEnable = TRUE;
    DepthWriteMask = ALL;
};

technique10 BuildShadowMap
{
	pass P0
	{
		SetVertexShader(CompileShader(vs_4_0, VS()));
		SetGeometryShader(NULL);
		SetPixelShader(CompileShader(ps_4_0, PS()));
		
		SetDepthStencilState( EnableDepth, 0 );
	}
}